<!DOCTYPE html>
<html>

<head>
	<meta charset='utf-8'>
	<meta http-equiv="X-UA-Compatible" content="chrome=1">
	<meta name="viewport" content="width=device-width,maximum-scale=2">

	<title>zmf96</title>
</head>

<body>

	<!-- HEADER -->
	<div id="header_wrap" class="outer">
		<header class="inner">


			<h1 id="project_title">zmf96</h1>
			<h2 id="project_tagline">听说能搭个静态网页，我也试试</h2>


		</header>
	</div>

	<!-- MAIN CONTENT -->
	<div id="main_content_wrap" class="outer">
		<section id="main_content" class="inner">
			<h2 id="贪吃蛇">贪吃蛇</h2>
			<canvas id="canvas" width="400" height="400"></canvas>

			<script>
				window.onkeydown=((ctx,snake,food,direction,move,draw)=>((loop,newFood,timer)=>Array.from({length:400}).forEach((_e,i)=>draw(ctx,i,"black"))||(timer=setInterval(()=>loop(newFood)||clearInterval(timer)||console.log(timer)||alert('Game Over'),200))&&(e=>direction=snake[1]-snake[0]==(move=[-1,-20,1,20][(e||event).keyCode-37]||direction)?direction:move))((newFood)=>snake.unshift(move=snake[0]+direction)&&snake.indexOf(move,1)>0||move<0||move>399||direction==1&&move%20==0||direction==-1&&move%20==19?false:(draw(ctx,move,"green")||move==food?newFood()&draw(ctx,food,"red"):draw(ctx,snake.pop(),"Black"))!==[],()=>Array.from({length:8000}).some(e=>snake.indexOf(food=~~(Math.random()*400))===-1)))(document.getElementById('canvas').getContext('2d'),[42,41],43,1,null,(ctx,node,color)=>(ctx.fillStyle=color)&ctx.fillRect(node%20*20+1,~~(node/20)*20+1,18,18));
			</script>


	</div>

	<!-- FOOTER  -->
	<div id="footer_wrap" class="outer">
		<footer class="inner">


			<a href="https://gitee.com/zmf96/">
				<p>gitee地址</p>
			</a>

		</footer>
	</div>


</body>

</html>